package com.jmp.security.grant.crmPc;

import com.jmp.security.base.ClientDetail;
import com.jmp.security.base.UserDetail;
import com.jmp.security.base.UserDetailService;
import one.stand.model.User;
import one.stand.service.UserService;
import one.stand.service.user.UserAdminService;

public class CrmPcSmsUserDetailServiceImpl implements UserDetailService<CrmPcSmsRequestDetail> {
    private UserAdminService userAdminService;
    private UserService userService;

    public CrmPcSmsUserDetailServiceImpl(UserAdminService userAdminService, UserService userService) {
        this.userAdminService = userAdminService;
        this.userService = userService;
    }

    @Override
    public UserDetail get(CrmPcSmsRequestDetail requestDetail, ClientDetail clientDetail) {
        User userModel = userService.getByPhone(requestDetail.getPhone(), requestDetail.getCompanyId());
        UserDetail userDetail = new UserDetail();
        userDetail.setUserModel(userModel);
        return userDetail;
    }
}
